Skip to content

Fix observability SDK breaking changes for Copilot Studio sample#269

Open
Yogeshp-MSFT wants to merge 1 commit intomicrosoft:mainfrom
Yogeshp-MSFT:Copilot-sample
Open

Fix observability SDK breaking changes for Copilot Studio sample#269
Yogeshp-MSFT wants to merge 1 commit intomicrosoft:mainfrom
Yogeshp-MSFT:Copilot-sample

Conversation

@Yogeshp-MSFT
Copy link
Copy Markdown

Summary

Aligns the Copilot Studio Node.js sample with the @microsoft/agents-a365-observability v0.1.0-preview.125 API, matching the patterns already adopted by the LangChain, Claude, OpenAI, and Vercel SDK samples.

Problem

The Copilot Studio sample was pinned to preview.30 / preview.64 SDK versions while the observability API had breaking changes in preview.125. This caused 3 TypeScript compilation errors:

  • TS2353: conversationId does not exist in type AgentDetails
  • TS2559: Type InferenceDetails has no properties in common with type Request
  • TS2339: Property recordResponseId does not exist on type InferenceScope

Changes

package.json — Updated SDK version

Package Before After
agents-a365-notifications ^0.1.0-preview.30 ^0.1.0-preview.125
agents-a365-observability ^0.1.0-preview.30 ^0.1.0-preview.125
agents-a365-observability-hosting ^0.1.0-preview.64 ^0.1.0-preview.125
agents-a365-runtime ^0.1.0-preview.30 ^0.1.0-preview.125

src/client.ts — Update imports

  • Removed TenantDetails import (type no longer needed)
  • Added Request import (new first parameter for InferenceScope.start)

src/client.ts — Update invokeInferenceScope()

  • Added Request object (~L127) with conversationId (previously on AgentDetails)
  • Moved tenantId into AgentDetails (~L137) instead of a separate TenantDetails object
  • Updated InferenceScope.start() call (~L143) from (inferenceDetails, agentDetails, tenantDetails)(request, inferenceDetails, agentDetails)
  • Removed scope.recordResponseId() call (method removed in new SDK)

src/agent.ts — Remove .correlationId() from BaggageBuilder chain

  • Removed .correlationId(corr-${Date.now()}) call (~L91) — method no longer exists on BaggageBuilder in the updated SDK

@Yogeshp-MSFT Yogeshp-MSFT requested a review from a team as a code owner April 8, 2026 11:41
Copilot AI review requested due to automatic review settings April 8, 2026 11:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Copilot Studio Node.js sample to compile and run against the @microsoft/agents-a365-observability 0.1.0-preview.125 breaking API changes, aligning it with the newer observability SDK patterns used by other samples.

Changes:

  • Bumps Agent 365 SDK package versions to ^0.1.0-preview.125.
  • Migrates InferenceScope.start() usage to the new (request, inferenceDetails, agentDetails) signature and removes deprecated APIs.
  • Updates baggage construction to remove the deprecated BaggageBuilder.correlationId() call.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
nodejs/copilot-studio/sample-agent/src/client.ts Updates observability imports and adapts inference scope creation to the new Request-based signature.
nodejs/copilot-studio/sample-agent/src/agent.ts Removes deprecated baggage builder chaining method.
nodejs/copilot-studio/sample-agent/package.json Updates Agent 365 SDK dependency versions to preview.125.
Comments suppressed due to low confidence (1)

nodejs/copilot-studio/sample-agent/src/client.ts:156

  • In the error path you record the exception but never set a finish reason, so failed inferences may show up without a terminal status in telemetry. Align with other samples by recording an explicit finish reason (e.g., ['error']) before rethrowing.
    } catch (error) {
      scope.recordError(error as Error);
      throw error;

@Yogeshp-MSFT
Copy link
Copy Markdown
Author

Hi @gwharris7 can you review this pr?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants